% 定义x和t的取值范围
x = linspace(0, 1, 100);
t = linspace(0, 2*pi, 100);
[X, T] = meshgrid(x, t);

% 定义函数 u(x,t)
U = (X - X.^2) .* exp(-T) + sin(T);

% 绘制三维曲面图
figure;
surf(X, T, U);
xlabel('x');
ylabel('t');
zlabel('u(x,t)');
title('u(x,t) = (x - x^2)e^{-t} + sin(t)');
shading interp;
colorbar;
view(45, 30); % 视角调整
